﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WeChat.CMS.Migrations
{
    /// <inheritdoc />
    public partial class updatedic : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_DataDictionarys",
                table: "DataDictionarys");

            migrationBuilder.DropPrimaryKey(
                name: "PK_DataDictionaryDetails",
                table: "DataDictionaryDetails");

            migrationBuilder.RenameTable(
                name: "DataDictionarys",
                newName: "DataDictionary");

            migrationBuilder.RenameTable(
                name: "DataDictionaryDetails",
                newName: "DataDictionaryDetail");

            migrationBuilder.AlterColumn<short>(
                name: "Sort",
                table: "DataDictionary",
                type: "smallint",
                nullable: false,
                defaultValue: (short)0,
                oldClrType: typeof(short),
                oldType: "smallint");

            migrationBuilder.AlterColumn<short>(
                name: "Sort",
                table: "DataDictionaryDetail",
                type: "smallint",
                nullable: false,
                defaultValue: (short)0,
                oldClrType: typeof(short),
                oldType: "smallint");

            migrationBuilder.AddPrimaryKey(
                name: "PK_DataDictionary",
                table: "DataDictionary",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_DataDictionaryDetail",
                table: "DataDictionaryDetail",
                column: "Id");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropPrimaryKey(
                name: "PK_DataDictionaryDetail",
                table: "DataDictionaryDetail");

            migrationBuilder.DropPrimaryKey(
                name: "PK_DataDictionary",
                table: "DataDictionary");

            migrationBuilder.RenameTable(
                name: "DataDictionaryDetail",
                newName: "DataDictionaryDetails");

            migrationBuilder.RenameTable(
                name: "DataDictionary",
                newName: "DataDictionarys");

            migrationBuilder.AlterColumn<short>(
                name: "Sort",
                table: "DataDictionaryDetails",
                type: "smallint",
                nullable: false,
                oldClrType: typeof(short),
                oldType: "smallint",
                oldDefaultValue: (short)0);

            migrationBuilder.AlterColumn<short>(
                name: "Sort",
                table: "DataDictionarys",
                type: "smallint",
                nullable: false,
                oldClrType: typeof(short),
                oldType: "smallint",
                oldDefaultValue: (short)0);

            migrationBuilder.AddPrimaryKey(
                name: "PK_DataDictionaryDetails",
                table: "DataDictionaryDetails",
                column: "Id");

            migrationBuilder.AddPrimaryKey(
                name: "PK_DataDictionarys",
                table: "DataDictionarys",
                column: "Id");
        }
    }
}
